import React from 'react';
import ReactDom from 'react-dom';

import Sub from './sub';
class Panel extends React.Component{
    constructor(props){
        super(props);
        this.state = {num:'0'};
        this.chuli = this.chuli.bind(this);
    }
    chuli(num1){
        this.setState({num:num1});
    }
    render(){
        return <div>
            <h2>{this.state.num}</h2>
            <Sub onFive={this.chuli}/>
        </div>
    }
}


ReactDom.render(<Panel/>, document.querySelector('#app'));
